<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html onclick="send(event)">
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
    </body>
    <script>
        var webServer = "ws://192.168.233.132:9501";
        var webSocket = new WebSocket(webServer);
        webSocket.onopen = function (evt) {
            alert("连接成功");
        }
        webSocket.onclose = function (evt) {
            console.log("关闭成功");
        }
        webSocket.onmessage = function (evt) {
            console.log(evt.data);
        }
        webSocket.onerror = function (evt, e) {
            console.log("error");
        }
        function send(event) {
            var message = "click at " + event.x + "," + event.y;
            webSocket.send(message);
        }
    </script>
</html>
